<!--_meta 作为公共模版分离出去-->
{include file="public/meta" /}
<!--/meta 作为公共模版分离出去-->
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="wap-container">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
        首页
        <span class="c-gray en">/</span>
        书籍管理
        <span class="c-gray en">/</span>
        审核
        <a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <article class="Hui-admin-content clearfix">
        <div class="panel">
            <div class="panel-body">
                <form action="" method="post" class="form form-horizontal" id="form-add">
                    <input type="hidden" class="input-text" value="{$model['id']}" placeholder=""
                           name="id">
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>名称：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" class="input-text" value="{$model.name}" placeholder="" name="name">
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2">热度：</label>
                        <div class="form-controls col-xs-8 col-sm-9">
                            <input type="text" name="hot" value="{$model.hot}" class="input-text"
                                   style="width:40%">
                        </div>
                    </div>
                    <div class="row clearfix">
                        <label class="form-label col-xs-4 col-sm-2">分类：</label>
                        <div class="form-controls col-xs-8 col-sm-9"> <span class="select-box" style="width:150px;">
							<select class="select" name="category_id" size="1">
                                {volist name="category" id="vo"}
								<option value="{$vo.id}" {if condition="$model.category_id==$vo.id"}selected {/if}>{$vo.name}</option>
                                {/volist}
							</select>
							</span></div>
                    </div>
                    <div class="row clearfix">
                        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                            <button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i
                                    class="Hui-iconfont">&#xe632;</i> 保存
                            </button>
                            <button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </article>
</div>
<!--_footer 作为公共模版分离出去-->
{include file="public/footer" /}
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/ueditor/1.4.3/ueditor.all.min.js"></script>
<script type="text/javascript" src="{__STATIC_PATH}admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>

<script type="text/javascript">
    $(function () {


        /* 表单验证，提交 */
        $("#form-add").validate({
            onkeyup: false,
            focusCleanup: false,
            submitHandler: function (form) {
                $.ajax({
                    url: "brand_edit",
                    type: "post",
                    data: $("form").serialize(),
                    success: function (res) {
                        if (res.code == 1) {
                            layer.msg(res.msg, {
                                icon: 1,
                                time: 1000 //2秒关闭（如果不配置，默认是3秒）
                            }, function () {
                                //do something
                                parent.location.replace(parent.location.href)
                                parent.layer.close(index);
                            });
                        } else {
                            layer.msg(res.msg, {icon: 2, time: 1000});
                        }
                    }
                })

            }
        });
    });
</script>
</body>
</html>
